package com.we.tickets.controller;

import com.alibaba.fastjson.JSONObject;
import com.we.tickets.service.TicketingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

@RestController
@RequestMapping("/ticketing")
public class TicketingController {
    @Autowired
    private TicketingService ticketingService;

    @PostMapping("/mintTickets")
    public JSONObject mintTickets(@RequestBody JSONObject jsonObject) {
        return ticketingService.mintTickets(jsonObject);
    }

    @PostMapping("/resellTicket")
    public JSONObject resellTicket(@RequestBody JSONObject jsonObject) {
        return ticketingService.resellTicket(jsonObject);
    }

    @PostMapping("/cancelReselling")
    public JSONObject cancelReselling(@RequestBody JSONObject jsonObject) {
        return ticketingService.cancelReselling(jsonObject);
    }

    @PostMapping("/returnTicket")
    public JSONObject returnTicket(@RequestBody JSONObject jsonObject) {
        return ticketingService.returnTicket(jsonObject);
    }

    @PostMapping("/grantTicket")
    public JSONObject grantTicket(@RequestBody JSONObject jsonObject) {
        return ticketingService.grantTicket(jsonObject);
    }

    @PostMapping("/cancelGranting")
    public JSONObject cancelGranting(@RequestBody JSONObject jsonObject) {
        return ticketingService.cancelGranting(jsonObject);
    }

    @PostMapping("/acceptTicket")
    public JSONObject acceptTicket(@RequestBody JSONObject jsonObject) {
        return ticketingService.acceptTicket(jsonObject);
    }

    @PostMapping("/refuseTicket")
    public JSONObject refuseTicket(@RequestBody JSONObject jsonObject) {
        return ticketingService.refuseTicket(jsonObject);
    }

    @PostMapping("/checkIn")
    public JSONObject checkIn(@RequestBody JSONObject jsonObject) {
        return ticketingService.checkIn(jsonObject);
    }

    @PostMapping("/getBuyableTicketsNum")
    public JSONObject getBuyableTicketsNum(@RequestBody JSONObject jsonObject) {
        return ticketingService.getBuyableTicketsNum(jsonObject);
    }

    @PostMapping("/getSoldTicketsNum")
    public JSONObject getSoldTicketsNum(@RequestBody JSONObject jsonObject) {
        return ticketingService.getSoldTicketsNum(jsonObject);
    }

    @PostMapping("/getLIFEInfo")
    public JSONObject getLIFEInfo(@RequestBody JSONObject jsonObject) {
        return ticketingService.getLIFEInfo(jsonObject);
    }

    @PostMapping("/getTicketsByOwnerId")
    public JSONObject getTicketsByOwnerId(@RequestBody JSONObject jsonObject) {
        return ticketingService.getTicketsByOwnerId(jsonObject);
    }

    @PostMapping("/getLIFEsOfOwner")
    public JSONObject getLIFEsOfOwner(@RequestBody JSONObject jsonObject) {
        return ticketingService.getLIFEsOfOwner(jsonObject);
    }

    @PostMapping("/getGranteeList")
    public JSONObject getGranteeList(@RequestBody JSONObject jsonObject) {
        return ticketingService.getGranteeList(jsonObject);
    }

    @PostMapping("/getNotices")
    public JSONObject getNotices(@RequestBody JSONObject jsonObject) {
        return ticketingService.getNotices(jsonObject);
    }

    @PostMapping("/deleteNotice")
    public JSONObject deleteNotice(@RequestBody JSONObject jsonObject) {
        return ticketingService.deleteNotice(jsonObject);
    }
}
